#include <iostream>
#include <string>

using namespace std;

class Complex
{
private:
    double real;
    double imag;
public:
    Complex()
        :real(0) , imag(0)
    {

    }
    Complex(double real , double imag)
        :real(real) , imag(imag)
    {

    }
    ~Complex()
    {

    }
    
public:
    void Show()
    {
        cout << "实部" << real << "虚部" <<imag <<endl;
    }
public:
    const Complex operator+(Complex R) const
    {
        Complex x;
        x.imag = this->imag + R.imag;
        x.real = this->real + R.real;
        return x;
    }

    const Complex operator-(Complex R) const
    {
        Complex x;
        x.imag = this->imag - R.imag;
        x.real = this->real + R.real;
        return x;
    }

    friend const Complex operator*(Complex L , Complex R);
};

const Complex operator*(Complex L , Complex R )
{
    Complex x;
    x.imag = L.imag * R.imag;
    x.real = L.real * R.real;
    return x;
}

int main(int argc, char const *argv[])
{
    Complex F1(10 , 30);
    Complex F2(10 , 30);
    Complex F3(10 , 30);

    F3 = F1+F2;
    F3.Show();

    F3 =F1 * F2;
    F3.Show();
    
    return 0;
}
